/**
 * Oauth login page, used in WordPress Desktop App
 */

.is-section-auth {
	height: 100%;

	.layout__content {
		height: 100%;
		margin: 0 auto;
		overflow: hidden;
		max-width: none;
		padding: 0;
	}

	.layout__content::after {
		content: none;
	}

	.layout__primary {
		height: 100%;
	}

	.masterbar {
		display: none;
	}
}

.auth.main {
	// Use WordPress.com’s brand color for the auth background
	background: var( --color-wordpress-com );
	float: none;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-content: center;
	max-width: 100%;
}

.auth__content {
	margin: 0 auto;
	text-align: center;

	.notice {
		width: calc( 100% - 20px );
		margin: 20px auto 0;
	}

	.notice.is-info {
		color: var( --color-neutral-0 );
		padding: 0;
		margin: 20px auto 0;
	}

	.notice.is-info .notice__text {
		padding: 0;
	}

	.notice.is-info .notice__icon {
		display: none;
	}
}

.auth__form {
	width: 320px;
	margin: 0 auto;

	.form-fieldset input {
		position: relative;
		z-index: z-index( 'root', '.auth__form .form-fieldset input' );
	}

	.form-fieldset input[type='text'],
	.form-fieldset input[type='password'] {
		padding-left: 36px;
	}

	.form-fieldset input:focus {
		z-index: z-index( 'root', '.auth__form .form-fieldset input:focus' );
	}

	.form-password-input {
		margin-top: -1px;
	}

	.form-buttons-bar button {
		float: none;
		margin: 0;
		width: calc( 100% - 20px );
	}

	.form-buttons-bar .button.is-primary[disabled],
	.form-fieldset input[type='password']:disabled,
	.form-fieldset input[type='text']:disabled {
		opacity: 0.5;
	}

	.form-fieldset input[type='text']:disabled {
		margin-bottom: 1px;
	}

	.form-fieldset input[type='tel'] {
		text-align: center;
	}

	.form-password-input__toggle-visibility {
		z-index: z-index( 'root', '.auth__form .form-password-input__toggle-visibility' );
		.gridicon {
			position: static;
		}
	}

	input[type='tel']::-webkit-inner-spin-button {
		-webkit-appearance: none;
		margin: 0;
	}
}

.auth__input-wrapper {
	position: relative;

	.gridicon {
		position: absolute;
		z-index: z-index( 'root', '.auth__input-wrapper .gridicon' );
		left: 8px;
		top: 7px;
		fill: var( --color-neutral-light );
	}
}

.auth__lost-password {
	margin-top: 1.5em;
	text-align: center;
}

.auth__lost-password a {
	color: var( --color-neutral-10 );
}

.auth__help,
.auth__help:visited {
	position: absolute;
	top: 16px;
	right: 16px;
	color: var( --color-text-inverted );
}

.auth__links {
	position: absolute;
	bottom: 40px;
	left: 0;
	right: 0;

	a,
	button {
		text-decoration: none;
		color: var( --color-text-inverted );
		margin: 0 16px;
		padding: 10px 0;
		cursor: pointer;
		font-size: inherit;

		&:hover,
		&:focus {
			color: var( --color-neutral-0 );
		}
	}
}

.auth__self-hosted-instructions {
	color: #fff;
	background: var( --color-primary-dark );
	border-radius: 8px;
	padding: 40px;
	position: absolute;
	z-index: z-index( 'root', '.auth__self-hosted-instructions' );
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% );
	min-width: 320px;
	max-width: 60%;
	max-height: 80%;
	overflow: auto;
	text-align: left;
	counter-reset: item;

	@include breakpoint( '<480px' ) {
		left: 0;
		top: -8px;
		right: 0;
		bottom: -8px;
		min-width: 0;
		min-height: 0;
		max-width: none;
		max-height: none;
		overflow: auto;
		transform: translate( 0, 0 );
		border-radius: 0;
	}

	ol {
		list-style: none;
		position: relative;
	}

	ol li {
		counter-increment: item;
		margin-bottom: 1.5em;
	}

	ol li::before {
		margin-right: 2em;
		content: counter( item );
		background: var( --color-surface );
		border-radius: 100%;
		color: var( --color-primary-dark );
		width: 24px;
		height: 24px;
		text-align: center;
		display: inline-block;
		position: absolute;
		left: -3em;
		font-weight: bold;
	}

	h2 {
		font-weight: bold;
		margin-bottom: 1.5em;
	}

	a {
		color: var( --color-primary-light );
		text-decoration: underline;
	}

	.auth__self-hosted-instructions-close {
		display: block;
		width: 24px;
		height: 24px;
		position: absolute;
		right: 10px;
		top: 10px;
		text-decoration: none;
		cursor: pointer;
		color: var( --color-text-inverted );
	}

	.auth__self-hosted-instructions-close:hover {
		color: var( --color-primary-light );
	}
}

.auth__welcome {
	color: var( --color-text-inverted );
}

.auth__connect-intro {
	width: 420px;
	margin: 0 auto;
}

.auth__connect .button,
.auth__connect .button:visited {
	background: #00a8db;
	border: #00a8db;
	color: var( --color-text-inverted );
}

.auth .pulsing-dot {
	top: 40%;
}
